package com.bcw.springtest;

import org.springframework.boot.Banner;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;


@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) throws InterruptedException {
        SpringApplication app = new SpringApplication(DemoApplication.class);
////		app.setBannerMode(Banner.Mode.OFF);
////		app.setWebApplicationType(WebApplicationType.NONE);
        ConfigurableApplicationContext context = app.run(new String[]{"1"});
//Thread.sleep(2000L);
//        SpringApplication.exit(context);
    }


	@Bean
	public ExitCodeGenerator exitCodeGenerator() {
		System.out.println("ExitCodeGenerator 在关闭之前执123123123123行");
		return () -> 42;
	}
//
//	@Override
//	public int getExitCode() {
//		System.out.println("ExitCodeGenerator 在关闭之前执行");
//		return 0;
//	}
}
